# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=net-tools
pkgver=1.60.20180212git
_commit=479bb4a7
pkgrel=1
pkgdesc="Configuration tools for Linux networking"
arch=('x86_64')
license=('GPL2')
url="http://net-tools.sourceforge.net/"
depends=('glibc')
makedepends=('git')
# use git snapshot currently prefered over release
source=("net-tools::git://git.code.sf.net/p/net-tools/code#commit=${_commit}")
options=(!makeflags)
sha1sums=('SKIP')


prepare() {
  sed -i "s#/sbin#/bin#" ${srcdir}/${pkgname}/Makefile
  sed -i "s#/usr##" ${srcdir}/${pkgname}/man/Makefile
}

build() {
  cd ${srcdir}/${pkgname}
  yes "" | make
}

package() {
  cd ${srcdir}/${pkgname}
  make DESTDIR=${pkgdir}/usr update

  # the following is provided by yp-tools
  rm "${pkgdir}"/usr/bin/{nis,yp}domainname
  rm "${pkgdir}"/usr/share/man/man1/{nis,yp}domainname.1

  # hostname is provided by inetutils
  rm "${pkgdir}"/usr/bin/{hostname,dnsdomainname,domainname}
  rm -rf "${pkgdir}"/usr/share/man/man1
}
